package cn.miw.android.bdmp3.model;

import java.util.List;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamImplicit;

@XStreamAlias("result")
public class ASong {
	private int count;
	@XStreamImplicit
	private List<ASongUrl> urls;
	@XStreamImplicit
	private List<ASongP2p> p2ps;

	public String getTrueURL() {
		String url = "";
		if ((urls != null) && (urls.size() > 0)) {
			for (ASongUrl aUrl : urls) {
				url = aUrl.getTrueURL();
				if(url!=""){
					break;
				}
			}
		}
		return url;
	}

	public String getLrcURL() {
		String url = "";
		if ((urls != null) && (urls.size() > 0)) {
			for (ASongUrl aUrl : urls) {
				url = aUrl.getLrcURL();
				if(url!=""){
					break;
				}
			}
		}
		return url;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public List<ASongUrl> getUrls() {
		return urls;
	}

	public void setUrls(List<ASongUrl> urls) {
		this.urls = urls;
	}

	public List<ASongP2p> getP2ps() {
		return p2ps;
	}

	public void setP2ps(List<ASongP2p> p2ps) {
		this.p2ps = p2ps;
	}

	@Override
	public String toString() {
		return "ASong [count=" + count + ", urls=" + urls + ", p2ps=" + p2ps + "]";
	}

}
